package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementOspfv3RouteMapper;
import com.ruoyi.net.domain.ElementOspfv3Route;
import com.ruoyi.net.service.IElementOspfv3RouteService;

/**
 * 网元-OSPFV3进程配置-路由重分发Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementOspfv3RouteServiceImpl implements IElementOspfv3RouteService 
{
    @Autowired
    private ElementOspfv3RouteMapper elementOspfv3RouteMapper;

    /**
     * 查询网元-OSPFV3进程配置-路由重分发
     * 
     * @param id 网元-OSPFV3进程配置-路由重分发主键
     * @return 网元-OSPFV3进程配置-路由重分发
     */
    @Override
    public ElementOspfv3Route selectElementOspfv3RouteById(String id)
    {
        return elementOspfv3RouteMapper.selectElementOspfv3RouteById(id);
    }

    /**
     * 查询网元-OSPFV3进程配置-路由重分发列表
     * 
     * @param elementOspfv3Route 网元-OSPFV3进程配置-路由重分发
     * @return 网元-OSPFV3进程配置-路由重分发
     */
    @Override
    public List<ElementOspfv3Route> selectElementOspfv3RouteList(ElementOspfv3Route elementOspfv3Route)
    {
        return elementOspfv3RouteMapper.selectElementOspfv3RouteList(elementOspfv3Route);
    }

    /**
     * 新增网元-OSPFV3进程配置-路由重分发
     * 
     * @param elementOspfv3Route 网元-OSPFV3进程配置-路由重分发
     * @return 结果
     */
    @Override
    public int insertElementOspfv3Route(ElementOspfv3Route elementOspfv3Route)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementOspfv3Route.getId())) {
            elementOspfv3Route.setId(uuid);
        }
        elementOspfv3Route.setCreateBy(SecurityUtils.getUsername());
        elementOspfv3Route.setCreateTime(DateUtils.getNowDate());
        elementOspfv3Route.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv3Route.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv3RouteMapper.insertElementOspfv3Route(elementOspfv3Route);
    }

    /**
     * 修改网元-OSPFV3进程配置-路由重分发
     * 
     * @param elementOspfv3Route 网元-OSPFV3进程配置-路由重分发
     * @return 结果
     */
    @Override
    public int updateElementOspfv3Route(ElementOspfv3Route elementOspfv3Route)
    {
        elementOspfv3Route.setUpdateBy(SecurityUtils.getUsername());
        elementOspfv3Route.setUpdateTime(DateUtils.getNowDate());
        return elementOspfv3RouteMapper.updateElementOspfv3Route(elementOspfv3Route);
    }

    /**
     * 批量删除网元-OSPFV3进程配置-路由重分发
     * 
     * @param ids 需要删除的网元-OSPFV3进程配置-路由重分发主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv3RouteByIds(String[] ids)
    {
        return elementOspfv3RouteMapper.deleteElementOspfv3RouteByIds(ids);
    }

    /**
     * 删除网元-OSPFV3进程配置-路由重分发信息
     * 
     * @param id 网元-OSPFV3进程配置-路由重分发主键
     * @return 结果
     */
    @Override
    public int deleteElementOspfv3RouteById(String id)
    {
        return elementOspfv3RouteMapper.deleteElementOspfv3RouteById(id);
    }
}
